package com.kakarote.hrm.constant;

import lombok.Getter;

@Getter
public enum OrgTypeEnum {

    ONE(1, "全资"),
    TWO(2, "控股"),
    THREE(3, "参股"),
    FOUR(4, "集体所有制");

    private Integer value;
    private String name;

    OrgTypeEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public static String getNameByValue(Integer value) {
        for (OrgTypeEnum educationEnum : OrgTypeEnum.values()) {
            if (educationEnum.getValue().equals(value)) {
                return educationEnum.getName();
            }
        }
        return "";
    }

    public static Integer getValueByName(String name) {
        for (OrgTypeEnum educationEnum : OrgTypeEnum.values()) {
            if (educationEnum.getName().equals(name)) {
                return educationEnum.getValue();
            }
        }
        return null;
    }

}
